import h from "./vdom/h";
import patch from "./patch";

const text = h("h1", {}, "HELLO");

const arr = h("div", {}, [
    h("span", {key: "c"}, "c"),
    h("span", {key: "d"}, "d"),
    h("span", {key: "a"}, "a"),
    h("span", {key: "b"}, "b"),
])

const arr2 = h("div", {}, [
    h("span", {key: "a"}, "a"),
    h("span", {key: "b"}, "b"),
    h("span", {key: "c"}, "c"),
    h("span", {key: "d"}, "d"),
    h("span", {key: "r"}, "r"),
])

const node = h("div", {}, "ggg")

const root = document.getElementById("root");

patch(root, arr);

document.getElementById("btn").onclick = function () {
    patch(arr, arr2);
}

